package edu.sias.hyznxfapi.controller;

import edu.sias.hyznxfapi.face.baidu.utils.BaiduAiUtils;
import edu.sias.hyznxfapi.vo.ImageVo;
import edu.sias.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/camera/analytics")
public class CameraAnalytics {
    @PostMapping("/faceNumberDetect")
    public AjaxResult faceNumberDetect(@RequestBody ImageVo imageVo) throws Exception {
        //先判断有几张人脸
        if (new BaiduAiUtils().faceNumberDetect(imageVo.getImageUrl())) {
            return AjaxResult.success("人脸识别成功");
        }
        return null;
    }
}
